CMake: Add picosystem_asset for packing .16bpp into .o#29
CMake: Add picosystem_asset for packing .16bpp into .o#29
Conversation
Use the linker to convert an asset into an .o file and include it in project sources. TODO: Fix const resources/.rodata assets
|
Awesome! I'm going to try this in my scratch project. [Edit: works as advertised, but my script (here) builds directly from an image, rather than a .16bpp binary, which makes the workflow a bit easier (though, I suppose I could run |
|
Our 32blit SDK has - effectively - a manifest of files which it slurps up and runs through the 32blit tool for packing/conversion. All very handy dandy and unlike this basic nonsense 😆 eg: https://github.com/32blit/rocks-and-diamonds/blob/main/assets.yml BUT... where's the fun in that? 32blit users got to build their own empire... PicoSystem users can have some fun too! (P.S. it's cool that you're putting together tools to serve your purposes, it's all part of the fun!) |
|
...ooo, that's pretty. I wonder how that works. |
|
@Gadgetoid are you looking for input/feedback on this? I have a half baked patch (minus the cmae stuff, I'm generating .h files manually and including them) that does more or less this, but defines a robuffer_t and templatizes some functions to they can use it. That way all data ends up in ROM. |
I was waiting until I had a moment to figure out how to do this. If you want to fork this branch for the CMake stuff and submit your own take on this PR I'd be happy to review it! |
Use the linker to convert an asset into an .o file and include it in project sources.
TODO: Fix const resources/.rodata assets
Example
Add the following to your
CMakeLists.txt:And to your main
.cpp: